package com.atguigu.srb.core.controller.api;



import com.atguigu.common.result.R;
import com.atguigu.srb.core.pojo.entity.Dict;
import com.atguigu.srb.core.service.DictService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@Api(tags = "绑定数据字典")
@RestController
@Slf4j
@RequestMapping("/api/core/dict")
public class ApiDictController {

    @Resource
    DictService dictService;
    @GetMapping("/findByDictCode/{dictCode}")
    public R findByDictCode(@ApiParam(value = "字典码",required = true)
                            @PathVariable("dictCode")String dictCode){
        List<Dict> dictList=   dictService.findByDictCode(dictCode);
        return R.ok().data("dictList",dictList);
    }
}
